import UIKit

extension NSCalendarUnit {
    
    /**
     取枚举中的多个值, 就需要按位或
     - parameter calendarUnits: 多个NSCalendarUnit值
     
     - returns: 多个值的按位或 值
     */
    static func calendarUnitMoreValue(calendarUnits: [NSCalendarUnit] = [.Second]) -> NSCalendarUnit {
        var result = calendarUnits.first!.rawValue
        for (_, value) in calendarUnits.enumerate() {
            result = result | value.rawValue
        }
        
        return NSCalendarUnit(rawValue: result)
    }
}